<?php $this->load->view('common/admin_header');?>
<div class="block">
  <div class="block_head">
    <div class="bheadl"></div>
    <div class="bheadr"></div>
    <h2><?=$lang['admin_lable_2']?></h2>
    <ul>
      <li class="active icon-caret-right"><a href="<?=site_url('admins/users')?>"><?=$lang['admin_lable_2']?></a></li>
      <li><a href="<?=site_url('admins/users_group')?>"><?=$lang['admin_lable_5']?></a></li>
    </ul>
  </div>
  <!-- .block_head ends -->
  <div class="block_content">
    <p class="breadcrumb"><?=$lang['global_lable_14']?> &raquo; <a href="<?=site_url('admins/index')?>"><?=$lang['global_lable_11']?></a> &raquo; <?=$lang['admin_lable_1']?> &raquo; <strong><?=$lang['admin_lable_2']?></strong></p>
    <?php $this->load->view('common/notify');?>
    <form action="<?=site_url('admins/users')?>" method="get">
      <input type="hidden" name="field" value="<?=isset($field)?$field:'n.sort_order'?>" id="field">
      <input type="hidden" name="sort" value="<?=isset($sort)?$sort:'asc'?>" id="sort">
      <table cellpadding="0" cellspacing="0" width="100%" class="sortable">
        <thead>
          <tr>
            <th><a id="id" class="<?=isset($field) && $field=='id'?$sort:'';?>" href="#">ID</a></th>
            <th><a id="login_name" class="<?=isset($field) && $field=='login_name'?$sort:'';?>" href="#"><?=$lang['admin_lable_3']?></a></th>
            <th><a id="group_id" class="<?=isset($field) && $field=='group_id'?$sort:'';?>" href="#"><?=$lang['admin_lable_4']?></a></th>
            <th><a id="status" class="<?=isset($field) && $field=='status'?$sort:'';?>" href="#"><?=$lang['global_lable_16']?></a></th>
            <th><a id="add_time" class="<?=isset($field) && $field=='add_time'?$sort:'';?>" href="#"><?=$lang['global_lable_18']?></a></th>
            <th align="center"><?=lang('cart_action')?></th>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td><input type="text" class="stext" name="login_name" lang="zh-TW" x-webkit-speech x-webkit-grammar="bUIltin:search" value="<?=isset($login_name)?$login_name:''?>"></td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td style="text-align:center">
              <input type="submit" class="btn btn-small btn-primary" name="sub_filter" value="<?=$lang['global_lable_22']?>"/>
              <a href="<?=site_url('admins/users/add')?>" class="btn btn-small btn-danger"><i class="icon-plus"></i> <?=$lang['global_lable_23']?></a>
            </td>
          </tr>
        </thead>
        <tbody class="table">
          <?php if(isset($lists_count) && $lists_count>0):?>
          <?php foreach($lists->result_array() as $list):
            $urls=site_url("admins/users/%s/".$list['id']);
            $status=$list['status']==1?$lang['global_lable_37']:$lang['global_lable_38'];
          ?>
          <tr>
            <td class="a-center"><?=$list['id']?></td>
            <td><?=$list['login_name']?></td>
		    <?php if($getlang=='zh-tw'):?>
            <td><?=$list['group_name']?></td>
		    <?php else:?>
		    <td><?=$list['group_ename']?></td>
		    <?php endif;?>
            <td><?=$status?></td>
            <td><?=date($format_time,$list['add_time'])?></td>
            <td class="listaction">
              <?php if($list['login_name']!='clickr'):?>
              <a href="<?=sprintf($urls,"edit");?>" class="l_edit"><?=$lang['global_lable_24']?></a>
              <a href="<?=sprintf($urls,"changepwd");?>" class="l_password"><?=$lang['global_lable_39']?></a>
              <a href="javascript:void(0);" onClick="delete_item('<?=sprintf($urls,"delete")?>');" class="l_delete"><?=$lang['global_lable_25']?></a>
              <?php else:?>
              <a href="javascript:void(0);" onClick="delete_clickr('<?=sprintf($urls,"delete")?>');" class="l_delete"><?=$lang['global_lable_25']?></a>
              <?php endif;?>
            </td>
          </tr>
          <?php endforeach;?>
          <?php else:?>
          <tr>
            <td colspan="9" style="text-align:center" class="nodata"><p><?=$lang['global_lable_42']?></p></td>
          </tr>
          <?php endif;?>
        </tbody>
      </table>
      <!-- .tableactions ends -->
      <div id="pagination"><?php echo $pagination;?><div class="listscount"><?=$lang['global_lable_29']?> <?=$lists_count?> <?=$lang['global_lable_30']?></div></div>
      <!-- .pagination ends -->
    </form>
  </div>
  <!-- .block_content ends -->
  <div class="bendl"></div>
  <div class="bendr"></div>
</div>
<!-- .block ends -->
<script  type="text/javascript" charset="utf-8">
function delete_clickr(url){
   if(url!=null && url.length>0){
       if(confirm("溫馨提示您,這是網站上線調試賬戶,如果您確定網站沒有修改則可以刪除,您確定要刪除該選項嗎?")){
        var id=arguments[2]?arguments[2]:0
        if(id>0){
          if(url.indexOf("?")<0)
            url+=id;
          else
            url=url+"&"+id;
        }
      location.href=url;
    }
  }
}
</script>
<?php $this->load->view('common/admin_footer');?>